/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Spyros
 */
@Entity
@Table(name = "periods")
@NamedQueries({
    @NamedQuery(name = "Periods.findAll", query = "SELECT p FROM Periods p"),
    @NamedQuery(name = "Periods.findById", query = "SELECT p FROM Periods p WHERE p.id = :id"),
    @NamedQuery(name = "Periods.findByPeriodStart", query = "SELECT p FROM Periods p WHERE p.periodStart = :periodStart"),
    @NamedQuery(name = "Periods.findByPeriodStop", query = "SELECT p FROM Periods p WHERE p.periodStop = :periodStop")})
public class Periods implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "period_start")
    @Temporal(TemporalType.DATE)
    private Date periodStart;
    @Basic(optional = false)
    @Column(name = "period_stop")
    @Temporal(TemporalType.DATE)
    private Date periodStop;

    public Periods() {
    }

    public Periods(Integer id) {
        this.id = id;
    }

    public Periods(Integer id, Date periodStart, Date periodStop) {
        this.id = id;
        this.periodStart = periodStart;
        this.periodStop = periodStop;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getPeriodStart() {
        return periodStart;
    }

    public void setPeriodStart(Date periodStart) {
        this.periodStart = periodStart;
    }

    public Date getPeriodStop() {
        return periodStop;
    }

    public void setPeriodStop(Date periodStop) {
        this.periodStop = periodStop;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Periods)) {
            return false;
        }
        Periods other = (Periods) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Periods[id=" + id + "]";
    }

}
